<template>
    <el-dialog
      title="编辑"
      :visible.sync="openDlg"
      width="800px"
      append-to-body
      destroy-on-close
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="学生姓名" prop="studentName">
                <el-input  v-model="form.studentName" disabled  placeholder="请输入学生姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="注册号" prop="registerCode">
                <el-input v-model="form.registerCode" disabled placeholder="请输入注册号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="返校时间" prop="returnDate">
                <el-date-picker
                    v-model="form.returnDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择日期时间">
                </el-date-picker>
            </el-form-item>
          </el-col>

          <!-- <el-col :span="12">
            <el-form-item label="出发地点" prop="goAddress">
                <el-input v-model="form.goAddress" placeholder="请输入goAddress" />
            </el-form-item>
          </el-col> -->
          <el-col :span="12">
            <el-form-item label="到达地点" prop="reachAddress">
                <el-input v-model="form.reachAddress" placeholder="请输入reachAddress" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="航班" prop="flight">
                <el-input v-model="form.flight" placeholder="请输入航班" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="机场" prop="airport">
                <el-input v-model="form.airport" placeholder="请输入机场" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="火车" prop="train">
                <el-input v-model="form.train" placeholder="请输入火车" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出发车站" prop="goSite">
                <el-input v-model="form.goSite" placeholder="请输入出发车站" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="到达车站" prop="reachSite">
                <el-input v-model="form.reachSite" placeholder="请输入到达车站" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="体温" prop="temperature">
                <el-input v-model="form.temperature" placeholder="请输入体温" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="健康状况" prop="health">
                <el-select style="width:100%" v-model="form.health" placeholder="请选择健康状况">
                    <el-option label="正常" value="0">正常</el-option>
                    <el-option label="异常" value="1">异常</el-option>
                </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="健康状况说明" prop="healthMsg">
                <el-input v-model="form.healthMsg" placeholder="请输入国家奖学金名额" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="特殊人群标记" prop="flag">
                <el-select style="width:100%" v-model="form.flag" placeholder="请选择特殊人群标记">
                    <el-option label="正常" value="0">正常</el-option>
                    <el-option label="已标记" value="1">已标记</el-option>
                </el-select>
            </el-form-item>
          </el-col>
          
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="openDlg = false">取 消</el-button>
      </div>
    </el-dialog>
</template>

<script>
import { 
    editToSchool
 } from "@/api/dailyroutine/toSchool.js";
export default {
    name:"editDlg",
    data () {
        return {
            openDlg: false,
            // 表单参数
            form: {
              
            },
            // 表单校验
            rules: {
              
            }
        }
    },
    methods:{
        open (rowdata) {
            this.form = JSON.parse(JSON.stringify(rowdata))
            this.openDlg = true
        },
        submitForm () {
          this.$refs["form"].validate((valid) => {
            if (valid) {
              if (this.form.id != undefined) {
                editToSchool(this.form).then((response) => {
                  this.$modal.msgSuccess("修改成功");
                  this.openDlg = false;
                  this.$emit("onSearch")
                });
              }
            }
          });
        },
    }

}
</script>

<style lang="scss" scoped>

</style>